(* This is a definition of a structure named "MaxArg" *) 
structure MaxArg = 
struct

(* This statement defines a short name for structure SLP, 
 * so you can use S.CompoundStm, S.Plus, S.IdExp, etc. to refer 
 * to items defined in structure SLP (see slp.sml) 
 *)
structure S = SLP
	      
exception Unimplemented

(* These are definitions of two mutually recursive functions, 
 * These functions will return the maximum number of arguments 
 * of any print statement within any subexpression of statement
 * given by the argument 's'. For example, if s represents statement
 * "print(a, print(b, c, d))"
 * (a,b,c,d are ids of variables), the result of maxarg s is 3.
 *
 * Attention!
 * print statements can contain expressions that contain other 
 * print statements
 *) 
fun maxarg s = 
    case s 
     of S.CompoundStm slist => raise Unimplemented (* add your code here *)
      | S.AssignStm (x, e) => raise Unimplemented (* add your code here *)
      | S.PrintStm elist =>  raise Unimplemented (* add your code here *)
                                   
and maxExpArg e =
    case e 
     of S.IdExp _ => 0
      | _ =>  raise Unimplemented (* add your code here and extend cases!! *) 

end
